#include "ApkLoader.h"

#ifdef ANDROID
#include "string.h"
#include "Utils.h"

ApkLoader* ApkLoader::instance = 0;

ApkLoader* ApkLoader::GetInstance()
{
	if(instance == 0)
	{
		PRINT("Init ApkLoader\n");
		instance = new ApkLoader();
	}
	return instance;
}
ApkLoader::ApkLoader(){}

void ApkLoader::LoadAPK(const char* apkFileName)
{
	apkFile = zip_open(apkFileName, 0, 0);
	if(apkFile==0)
		PRINT("Load apk error\n");
}

void ApkLoader::SetApkFileName(const char* apkFileName)
{
	strcpy(this->apkFileName, apkFileName);
}

void ApkLoader::Destroy()
{
	PRINT("Destroy ApkLoader\n");
	DELETE_SAFELY(instance);
}
#endif